<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<style>
    .error {
        color: red;
    }

</style>
<form:form commandName="capitalFilter" cssClass="form-horizontal"
           role="form" onsubmit="return false;">

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">申报单号</label>
        <div class="col-sm-4">
            <input type="text" name="summaryId" id="summary-Id"
                   placeholder="请输入申报单号" value="${capitalFilter.summaryId}"
                   class="form-control ">
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="park">所属园区</label>
        <div class="col-sm-4">
            <input type="text" name="park" id="park"
                   value="${capitalFilter.park}"
                   class="form-control ">
        </div>
    </div>



    <div class="form-group">

        <label class="col-sm-2 control-label no-padding-right"
               for="projectType">项目状态</label>
        <div class="col-sm-4">
            <select name="projectType" class="form-control "
                    style="width: 100%" data-placeholder="请选择" id="projectType">
                <option value="${capitalFilter.projectType}">${capitalFilter.projectType}</option>
                <option value="纳统项目">纳统项目</option>
                <option value="纳税项目">纳税项目</option>
                <option value="开业项目">开业项目</option>
                <option value="剩余项目">剩余项目</option>
            </select>
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for=projectName>项目名称</label>
        <div class="col-sm-4">
            <input type="text" name="projectName" id="project-Name"
                   placeholder="请输入项目名称" value="${capitalFilter.projectName}"
                   class="form-control " >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="investorName">投资方名</label>
        <div class="col-sm-4">
            <input type="text" name="investorName" id="investor-Name"
                   placeholder="请输入投资方名称" value="${capitalFilter.investorName}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="finalInver">总投资额（亿元）</label>
        <div class="col-sm-4">
            <input type="text" name="finalInver" id="finalInver"
                   placeholder="请输入申报全额" value="${capitalFilter.finalInver}"
                   class="form-control ">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="projectStatus">项目状态</label>
        <div class="col-sm-4">
            <select name="projectStatus" class="form-control "
                    style="width: 100%" data-placeholder="请选择" id="projectStatus">
                <option value="${capitalFilter.projectStatus}">${capitalFilter.projectStatus}</option>
                <option value="项目无法落地">项目无法落地</option>
                <option value="仍在审批阶段、未办结">仍在审批阶段、未办结</option>
                <option value="已开工建设、未建成投产或正式营业">已开工建设、未建成投产或正式营业</option>
            </select>
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="attribute">三维属性</label>
        <div class="col-sm-4">
            <input type="text" name="attribute" id="_attribute"
                   value="${capitalFilter.attribute}"
                   class="form-control ">
        </div>
    </div>




    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="industrialClassfly">产业分类</label>
        <div class="col-sm-4">
            <input type="text" name="industrialClassfly" id="_industrialClassfly"
                   value="${capitalFilter.industrialClassfly}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="projectStage">项目阶段</label>
        <div class="col-sm-4">
            <input type="text" name="projectStage" id="projectStage"
                   value="${capitalFilter.projectStage}"
                   class="form-control ">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="isCapitalProject">是否为增资项目</label>
        <div class="col-sm-4">
            <input type="text" name="isCapitalProject" id="isCapitalProject"
                   value="${capitalFilter.isCapitalProject}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="beforeCapital">增资前</label>
        <div class="col-sm-4">
            <input type="text" name="beforeCapital" id="beforeCapital"
                   value="${capitalFilter.beforeCapital}"
                   class="form-control " >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="afterCapital">增资后</label>
        <div class="col-sm-4">
            <input type="text" name="afterCapital" id="afterCapital"
                    value="${capitalFilter.afterCapital}"
            class="form-control ">
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="isOpen">是否开业</label>
        <div class="col-sm-4">
            <select name="isOpen" class="form-control "
                    style="width: 100%" data-placeholder="请选择" id="isOpen">
                <option value="${capitalFilter.isOpen}">${capitalFilter.isOpen}</option>
                <option value="否">否</option>
                <option value="是">是</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"  for="paySocialSecurity">是否缴纳社保</label>
        <div class="col-sm-4">
            <input type="text" name="paySocialSecurity" id="paySocialSecurity"
                   value="${capitalFilter.paySocialSecurity}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="payNumber">缴纳养老保险金人数</label>
        <div class="col-sm-4">
            <input type="text" name="payNumber" id="payNumber"
                   value="${capitalFilter.afterCapital}"
                   class="form-control ">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="isRatepay">是否纳税</label>
        <div class="col-sm-4">
            <select name="isRatepay" class="form-control "
                    style="width: 100%" data-placeholder="请选择" id="isRatepay">
                <option value="${capitalFilter.isRatepay}">${capitalFilter.isRatepay}</option>
                <option value="否">否</option>
                <option value="是">是</option>
            </select>
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="payUnit">纳税单位</label>
        <div class="col-sm-4">
            <input type="text" name="payUnit" id="payUnit"
                   placeholder="请输入纳税单位" value="${capitalFilter.payUnit}"
                   class="form-control ">
        </div>


    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="ratepayTime">纳税时间</label>
        <div class="col-sm-4">
            <input type="text" name="ratepayTime" id="ratepayTime"
                   value="${capitalFilter.ratepayTime}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="nationalTax">国税额</label>
        <div class="col-sm-4">
            <input type="text" name="nationalTax" id="nationalTax"
                   value="${capitalFilter.nationalTax}"
                   class="form-control " >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="landTax">地税额</label>
        <div class="col-sm-4">
            <input type="text" name="landTax" id="landTax"
                   value="${capitalFilter.landTax}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="totalRatepay">纳税合计</label>
        <div class="col-sm-4">
            <input type="text" name="totalRatepay" id="totalRatepay"
                   value="${capitalFilter.totalRatepay}"
                   class="form-control " >
        </div>

    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="taxReturnData">申报纳税数据</label>
        <div class="col-sm-4">
            <input type="text" name="taxReturnData" id="taxReturnData"
                   value="${capitalFilter.taxReturnData}"
                   class="form-control " >
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="isnnu">是否纳统</label>
        <div class="col-sm-4">
            <select name="isnnu" class="form-control "
                    style="width: 100%" data-placeholder="请选择" id="isnnu">
                <option value="${capitalFilter.isnnu}">${capitalFilter.isnnu}</option>
                <option value="否">否</option>
                <option value="是">是</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="solidInver">固投</label>
        <div class="col-sm-4">
            <input type="text" name="solidInver" id="solidInver"
                    value="${capitalFilter.solidInver}"
                   class="form-control ">
        </div>

        <label class="col-sm-2 control-label no-padding-right"
               for="solidTime">时间</label>
        <div class="col-sm-4">
            <input type="text" name="solidTime" id="solidTime"
                   value="${capitalFilter.solidTime}"
                   class="form-control ">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="productionInver">产值金额</label>
        <div class="col-sm-4">
            <input type="text" name="productionInver" id="productionInver"
                   value="${capitalFilter.productionInver}"
                   class="form-control ">
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="productionTime">产值时间</label>
        <div class="col-sm-4">
            <input type="text" name="productionTime" id="productionTime"
                   value="${capitalFilter.taxReturnData}"
                   class="form-control " >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="operatingIncome">营业收入</label>
        <div class="col-sm-4">
            <input type="text" name="operatingIncome" id="operatingIncome"
                   value="${capitalFilter.operatingIncome}"
                   class="form-control ">
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="operatingTime">营业收入时间</label>
        <div class="col-sm-4">
            <input type="text" name="operatingTime" id="operatingTime"
                   value="${capitalFilter.operatingTime}"
                   class="form-control " >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right"
               for="natongData">申报纳统数据</label>
        <div class="col-sm-4">
            <input type="text" name="natongData" id="natongData"
                   value="${capitalFilter.natongData}"
                   class="form-control ">
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="completelyStripped">是否完全剥离</label>
        <div class="col-sm-4">
            <input type="text" name="completelyStripped" id="completelyStripped"
                   value="${capitalFilter.completelyStripped}"
                   class="form-control " >
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="taxproof">佐证材料</label>
        <input class="col-sm-4" type="file" id="fileupload" name="files"
               accept=".zip"/> <br>

        <button class="col-sm-5 btn btn-large btn-primary" id="btn">上传</button>

        <input type="text" name="taxproof" id="taxproof"
               value="${capitalFilter.taxproof}" class="form-control "
               style="display: none" />
        <input type="text" name="isaudit" id="isaudit"
               value="${capitalFilter.isaudit}" class="form-control "  style="display: none"
        />
    </div>






    <form:hidden path="sysId" />
</form:form>
<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/jquery-ui.js"></s:url>"></script>
<%--
<div id="dialog" title="提示">
    <div class="progress progress-striped active">
        <div class="progress-bar progress-bar-success" role="progressbar"
             aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
             style="width: 100%;"></div>

    </div>
    <p>正在上传 请稍后……</p>
</div>--%>
<script type="text/javascript">
    $('#editor1').ace_wysiwyg({
        toolbar : [ 'font', null, 'fontSize', null, {
            name : 'bold',
            className : 'btn-info'
        }, {
            name : 'italic',
            className : 'btn-info'
        }, {
            name : 'strikethrough',
            className : 'btn-info'
        }, {
            name : 'underline',
            className : 'btn-info'
        }, null, {
            name : 'createLink',
            className : 'btn-pink'
        }, {
            name : 'unlink',
            className : 'btn-pink'
        }, null, {
            name : 'insertImage',
            className : 'btn-success'
        }, null, 'foreColor', null, {
            name : 'undo',
            className : 'btn-grey'
        }, {
            name : 'redo',
            className : 'btn-grey'
        } ]
    });


    $("#dialog").hide();
    $("#btn").click(function() {
        var fileval = $("#fileupload").val();
        if (fileval == null || fileval == "") {
            alert("未选择任何文件");
            return;
        }
/*
        $("#dialog").show();
        $("#dialog").dialog();*/
        $(".shade").fadeIn(100);
        $(".warning").fadeIn(100);
        $('.la-square-jelly-box').show();
        showShade();
        //警告框自定义内容
        $('.warning>.title>em').html('加载中……');
        $.ajaxFileUpload({
            type : "post",
            fileElementId : "fileupload",
            secureuri : false,
            dataType : 'json',
            url : "/pictureUpload/uploadBatch",
            async : false,
            success : function(data) {
                var val = data.data.sysid;
                //console.log(val);
                $("#taxproof").attr("value", val);
              /*  $("#dialog").dialog("close");*/
               /* alert("成功");*/
                $('.warning>.title>em').html('上传成功');
                $('#btn').html('文件已上传');
            },
            error : function(data) {
                console.log(data);
             /*   $("#dialog").dialog("close");*/
                alert("佐证材料上传失败 ！！请联系管理员");
            }

        });

    });
    var isauditval = $("#isaudit").val();
    //console.log(isauditval);
    if(isauditval=='1'){
        $("#updatebtn").attr("disabled", true);
        //console.log(isauditval+"111");
    }


//    function findtwoClass() {
//        var teamID = $("#team-ClassId").val();
//        var teamClassname = $("#team-ClassId").find("option:selected").text();
//        $("#teamClass").attr("value",teamClassname);
////        console.log(teamID);
//        //alert(teamID);
//        var teamcla = {
//            "teamId" : teamID
//        };
//
//        $.ajax({
//            url : "/chart/show/getTeamclassNames",
//            dataType : "json", //返回数据形式为json
//            type : "POST",
//            contentType : 'application/json;charset=UTF-8',
//            data : JSON.stringify(teamcla),
//            success : function(data) {
//                $("#team-name option").remove();
//                // $("#team-name").append(" <option >请选择小分队</option>");
//                for (var i = 0; i < data.data.length; i++) {
//                    var teamid = data.data[i].teamId;
//                    var teamname = data.data[i].teamName;
//                    $("#team-name").append(
//                        "<option value='"+teamname+"'>" + teamname
//                        + "</option>");
//                    //console.log(teamname);
//                }
//            }
//        });
//
//    }

    $("#summary-Id").blur(function () {
        console.log("meiy jiaodian ");
        var summaryid= $("#summary-Id").val();
        console.log("id"+summaryid);
        $.ajax({
            url : "/chart/show/getProjectName",
            dataType : "json", //返回数据形式为json
            type : "POST",
            contentType : 'application/json;charset=UTF-8',
            data : JSON.stringify({"summaryId" : summaryid}),
            success : function(data) {
                console.log(data);
                if(data.data){
                    $("#project-Name").attr("value",data.data.projectName);
                    $("#investor-Name").attr("value",data.data.investorName);
                    $("#_attribute").attr("value",data.data.attribute);
                    $("#_industrialClassfly").attr("value",data.data.industrialClassfly);
                    $("#team-ClassId").attr("value",data.data.teamClass);
                    $("#team-name").attr("value",data.data.teamName);
                }else
                {
                    // 警告框
                    $(".shade").fadeIn(100);
                    $(".warning").fadeIn(100);
                    showShade();
                    //警告框自定义内容
                    $('.warning>.cont').html('对不起，找不到这个项目，请确认申报单号是否正确');
                    $("#summary-Id").val("");
                }
            }
        });

    });
</script>
